<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>我的收货地址</title>
    
    <script src="<%=basePath%>js/fontSize.js"></script>
    <script src="<%=basePath%>js/jquery-1.11.3.min.js"></script>
    
    <link rel="stylesheet" href="<%=basePath%>css/style.css"/>
    <link rel="stylesheet" href="<%=basePath%>css/style2.css"/>
    
    <link rel="stylesheet" href="<%=basePath%>plugins/layer/mobile/need/layer.css"/>
    <script src="<%=basePath%>plugins/layer/mobile/layer.js"></script>
    
    
    <style>
  		body{ background:#F5F5F6;color:#ffffff;}
  		.new_address_btn {
  			height:2rem;width:100%;background:#06c1ae;position:fixed;bottom:0px;text-align:center;font-size:14px;color:#ffffff;line-height:2rem;
  		}
  		a:hover{
  			color:#ffffff;
  		}
	</style>
</head>

<body>
  <!--头部1-->
  <header class="header3 padding-lr1 background6">
    <p class="header3-left"><a href="<%=basePath%>member/info"><span class="ico bgico-7" style="background-image: url(<%=basePath%>images/img25.png)"></span></a></p>
    <h2 class="header3-title text-align-center color1">我的寻宝</h2>
    <div class="header3-right">
      <figure class="dolamr">
      
        <div class="dolamr-zksq color1">
        	<c:if test="${fn:length(listShippingAddress) > 0}">
         	<a href="javascript:void(0)" id="sub">编辑</a>
         	</c:if>
        </div>
      </figure>
    </div>
    
    <div class="clear-both"></div>
  </header>
  <!--/头部1-->
  <c:forEach items="${listShippingAddress}" var="shippingAddress">
  <div style="background:#ffffff;height:3rem;width:100%;border-bottom:1px solid #ccc;color:#000;">
  	<input type="hidden" id="id" value="${shippingAddress.id}">
  	<p style="font-size:16px;padding:0.5rem;">${shippingAddress.name}&nbsp;&nbsp;${shippingAddress.phone}</p>
  	<p style="font-size:12px;color:#919191;padding:0 0.5rem;">${shippingAddress.province_txt}&nbsp;&nbsp;${shippingAddress.city_txt}&nbsp;&nbsp;${shippingAddress.area_txt}&nbsp;&nbsp;${shippingAddress.address}</p>
  </div>
  </c:forEach>
  <c:if test="${fn:length(listShippingAddress) == 0}">
  <a href="<%=basePath%>new_address.jsp" class="new_address_btn">新增收货地址</a>
  </c:if>
  <script type="text/javascript">
  	$(function(){
  		$("#sub").on("click", function() {
  			var ctx = "${pageContext.request.contextPath}";
  			window.location.href = ctx + "/myAddress/info";
  		});
  	});
  </script>
</body>
</html>